import request from '@/axios';

export const getListDataScope = (current, size, params) => request({
  url: '/zzy-system/data-scope/list',
  method: 'get',
  params: {
    ...params,
    current,
    size,
  },
});

export const removeDataScope = ids => request({
  url: '/zzy-system/data-scope/remove',
  method: 'post',
  params: {
    ids,
  },
});

export const addDataScope = row => request({
  url: '/zzy-system/data-scope/submit',
  method: 'post',
  data: row,
});

export const updateDataScope = row => request({
  url: '/zzy-system/data-scope/submit',
  method: 'post',
  data: row,
});

export const getMenuDataScope = id => request({
  url: '/zzy-system/data-scope/detail',
  method: 'get',
  params: {
    id,
  },
});

export const getListApiScope = (current, size, params) => request({
  url: '/zzy-system/api-scope/list',
  method: 'get',
  params: {
    ...params,
    current,
    size,
  },
});

export const removeApiScope = ids => request({
  url: '/zzy-system/api-scope/remove',
  method: 'post',
  params: {
    ids,
  },
});

export const addApiScope = row => request({
  url: '/zzy-system/api-scope/submit',
  method: 'post',
  data: row,
});

export const updateApiScope = row => request({
  url: '/zzy-system/api-scope/submit',
  method: 'post',
  data: row,
});

export const getMenuApiScope = id => request({
  url: '/zzy-system/api-scope/detail',
  method: 'get',
  params: {
    id,
  },
});
